# Example plugin script
# needs to define init() ... otherwise it's dumped after load

irc = None

def init(bot):
    global irc
    bot.cmd.events['PRIVMSG'].subscribe(privmsg)
    irc = bot
    print "example plugin init"

def privmsg(sender, args):
    global irc
    msg = args[0]
    if msg == "!suck":
        irc.privmsg(args[2], "Man... sloat sucks.")
    elif msg == "get lost":
        if irc.chmgr.get(args[2]).isop(sender.nick):
            irc.quit("you're the boss")
            pass
    elif msg == "!assrape":
        if irc.chmgr.get(args[2]).isop(sender.nick):
            try: name = args[0][1]
            except: name = ""
            print name
    elif msg == "\001VERSION\001":
        irc.ctcp_reply(sender.nick, "VERSION %s" % irc.version)
    elif msg == "debug":
        print irc.chmgr.channels

